using UnityEngine;
using UnityEngine.UI;
using TEngine;

namespace GameLogic
{
    [Window(UILayer.UI)]
    class EventWindow1 : UIWindow
    {
        #region 脚本工具生成的代码
        private Button m_btnAddEvent;
        private Button m_btnDelEvent;
        protected override void ScriptGenerator()
        {
            m_btnAddEvent = FindChildComponent<Button>("m_btnAddEvent");
            m_btnDelEvent = FindChildComponent<Button>("m_btnDelEvent");
            m_btnAddEvent.onClick.AddListener(OnClickAddEventBtn);
            m_btnDelEvent.onClick.AddListener(OnClickDelEventBtn);
        }
        #endregion

        #region 事件
        private void OnClickAddEventBtn()
        {
            //添加事件监听string
            GameEvent.AddEventListener("TEngine", TodoSomeThings);
        }
        private void OnClickDelEventBtn()
        {
            GameEvent.RemoveEventListener("TEngine", TodoSomeThings);
        }
        #endregion
        int count = 0;
        void TodoSomeThings()
        {
            Debug.Log("TEngine天下第一"+count++);
        }
    }
}
